package com.zhao.blog.dao;

import com.zhao.blog.pojo.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author xiaoZhao
 * @date 2021/12/27
 * @describe
 */
public interface TypeDao extends JpaRepository<Type,Long> {

    Type findByName(String name);

    @Query("select t from t_type t ")
    List<Type> findTop(Pageable pageable);
}
